package com.novellotus.iov.carvice.activity;

import android.os.Bundle;
import android.widget.TextView;

import com.novellotus.iov.carvice.R;
import com.novellotus.iov.carvice.bean.RxOrder;
import com.novellotus.iov.carvice.utils.TimeUtils;

import butterknife.BindView;
import butterknife.OnClick;

public class PayRecordDetailActivity extends BaseActivity {

    @BindView(R.id.tv_tittle)
    TextView tv_tittle;
    @BindView(R.id.tv_station_name)
    TextView tv_station_name;
    @BindView(R.id.tv_station_type)
    TextView tv_station_type;
    @BindView(R.id.tv_charge_count)
    TextView tv_charge_count;
    @BindView(R.id.tv_charge_time)
    TextView tv_charge_time;
    @BindView(R.id.tv_charge_section)
    TextView tv_charge_section;
    @BindView(R.id.tv_num)
    TextView tv_num;
    @BindView(R.id.tv_pay_time)
    TextView tv_pay_time;
    @BindView(R.id.tv_pay_type)
    TextView tv_pay_type;
    @BindView(R.id.tv_cost_value)
    TextView tv_cost_value;
    @BindView(R.id.tv_station_value)
    TextView tv_station_value;
    @BindView(R.id.tv_discount_value)
    TextView tv_discount_value;
    @BindView(R.id.tv_little_count_value)
    TextView tv_little_count_value;

    RxOrder.RecordsBean recordsBean;


    @Override
    protected void initContentView(Bundle savedInstanceState) {
        setContentView(R.layout.activity_pay_record_detail);
    }

    @Override
    public void init() {
        tv_tittle.setText("订单详情");

        recordsBean = getIntent().getParcelableExtra("record");
        tv_charge_count.setText("充电度数: "+recordsBean.getChargeDegrees());
        tv_charge_time.setText("充电时长: "+recordsBean.getChargeDate()+"");
        tv_charge_section.setText("充电区间: "+TimeUtils.stampTotime(recordsBean.getStartDate()+"")+"~"+TimeUtils.stampTotime(recordsBean.getEndDate()+""));
        tv_num.setText("订单编号: "+recordsBean.getOrderNo());
        tv_pay_time.setText("支付时间: "+TimeUtils.stampTotime(recordsBean.getPayDate()+""));
        tv_pay_type.setText("支付方式: "+recordsBean.getPayTypeDesc());
        tv_cost_value.setText("¥ " +recordsBean.getChargeAmount());
        tv_station_value.setText("¥ " +recordsBean.getStationDisAmount());
        tv_discount_value.setText("¥ " +recordsBean.getPlatDisAmount());
        tv_little_count_value.setText("¥ " + recordsBean.getPayAmount());
    }

    @OnClick(R.id.img_back)
    void back() {
        finish();
    }
}
